import Popup from "./Popup";
import App from "../framework/App";

const { ccclass, property } = cc._decorator;

@ccclass
export default class PopupAlert extends Popup {

    @property(cc.Label)
    label: cc.Label = null;

    static show(content: string, onClose?: Function) {
        let instance = cc.instantiate(App.instance.popupAlert);
        cc.Canvas.instance.node.addChild(instance);
        let popupAlert: PopupAlert = instance.getComponent(PopupAlert);
        if (content) {
            popupAlert.label.string = content;
        }
        popupAlert.onClose = onClose;
    }



}
